package com.ying.interceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author liujunjie
 * @Description description
 * @Note Hope we enjoy ourselves everday:)
 * @Date 2024-03-03 21:34
 **/
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {
    @Bean
    public IpCountInterceptor interceptor() {
        return new IpCountInterceptor();
    }
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptor()).addPathPatterns("/**");
    }


}
